<script>
import Baseoption from "../components/base.vue";
export default {
  props: ["node"],
  components: { Baseoption },
  data() {
    return {
      a: null,
      blurIndex:0
    };
  },

  mounted() {
     this.blurIndex=this.node.content.length
  },
  render(h) {
    return (
      <div>
        <Baseoption node={this.node}></Baseoption>
        <el-divider direction="horizontal" content-position="center">
          内容
        </el-divider>{" "}
        <el-button
          type="text"
          icon="el-icon-plus"
          size="mini"
          nativeOnClick={(e) => {
            this.node.content=this.node.content.slice(0, this.blurIndex) + "$input" + this.node.content.slice(this.blurIndex);
          }}
        >
          插入填空
        </el-button>
        <el-input
          type="textarea"
          rows={4}
          value={this.node.content}
          placeholder="请输入"
          onInput={(e) => {
            this.node.content = e;
          }}
          onBlur={(e)=>{
            this.blurIndex = e.srcElement.selectionStart
          }}
          size="small"
          clearable
        ></el-input>
      </div>
    );
  },
};
</script>

<style scoped></style>
